package helpers

import (
  "net/http"
)

type paramField struct {
  r *http.Request
}

func NewParamField(r *http.Request) *paramField {
  return &paramField{
    r: r,
  }
}

func (that *paramField) GetDefault(key, defValue string) string {
  value := that.r.URL.Query().Get(key)
  if value == "" {
    return defValue
  }
  return value
}
